/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 100;

int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    std::vector<int> a(n);
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    std::sort(a.begin(), a.end());
    std::reverse(a.begin(), a.end());
    bool flag = true;
    std::vector<int> sum(n);
    if (a[0] == a[1]) {
      if (n == 2) {
        flag = false;
      } else {
        auto iter =
            std::find_if(a.begin(), a.end(), [&](int x) { return x != a[0]; });
        if (iter != a.end())
          std::swap(a[1], *iter);
        else {
          flag = false;
        }
      }
    }

    cout << (flag ? "YES\n" : "NO\n");
    if (flag) {
      for (auto i : a) {
        cout << i << ' ';
      }
      cout << endl;
    }
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("A. Make it Beautiful.in", "r", stdin);
  freopen("A. Make it Beautiful.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
